<?php

/**
 *   OPENSHOP 管理中心taobao 用户管理API
 * 
 *   @link        http://baison.com.cn
 *   @copyright   Baison, Inc.
 *   @package     OpenShop
 *   @version     $Id: api_tb_user.php,v 1.0 2009年10月17日13:30:13 created$
 *   @author      winner <jsycywm@hotmail.com>
 */

define('IN_OS', true);

require(dirname(__FILE__) . '/includes/init.php');
require(ROOT_PATH . '/includes/modules/taobao.api/cls_api.php');
$exc = new exchange($os->table('taobao_goods'), $db, 'goods_id', 'goods_sn');

/*------------------------------------------------------ */
//-- 办事处列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list'){	
	//检查权限
	admin_priv();
	
	$obj_api = new taobao_api();
	$obj_api->api_method = 'taobao.sellercats.list.get';  //自己定义类目 $obj_api->api_method ='taobao.shopcats.list.get';		// 'taobao.trades.sold.get';
 	$obj_api->api_nick='优衣派服饰专营店';
	$smarty->assign('shopcats', $obj_api->fetchItems('seller_cat')); 
    assign_query_info();
    
    $smarty->display('api_tb_shopcat_manage.tpl');
}elseif($_REQUEST['act'] == 'get_item'){
	$obj_api = new taobao_api();
	$obj_api->api_method = 'taobao.user.get';
	$obj_api->api_fields = 'user_id,nick,sex,location.city,location.state,location.country,location.zip,created,
	                        last_visit,birthday,status';
	$result = $obj_api->fetchItem(array('nick'=>$_GET['nick']));	
	print_r($result);
}elseif($_REQUEST['act'] == 'custom'){
	$obj_api = new taobao_api();
	$obj_api->api_method = 'taobao.shopcats.list.get';     //自己定义类目
	$smarty->assign('shopcats', $obj_api->fetchItems('shop_cat'));
    assign_query_info(); 
    $smarty->display('api_tb_shopcat_manage.tpl');
	
}
elseif($_REQUEST['act'] == 'shopinfo'){
	
	echo ('33333333333333');
	
   $result = 	UpLoadGoods('269365005');
   
   print_r($result);
	
	die("测试");
	
	$obj_api = new taobao_api();
	$obj_api->api_method = 'taobao.shop.get';     //自己定义类目
	$obj_api->api_fields='sid,cid,title,nick,desc,bulletin,pic_path,created,modified';
	$obj_api->api_nick='优衣派服饰专营店';
	$smarty->assign('shopcats', $obj_api->fetchItems('shop'));
    assign_query_info(); 
    $smarty->display('api_tb_shopcat_manage.tpl');
	
}
?>